<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="UTF-8" />
    <title>Menu - a11y</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
    <link href="../../../../../css/core.css" rel="stylesheet" />
    <link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
    <script src="../../../../../scripts/testing/scripts.js"></script>
    <script nomodule src="../../../../../dist/ionic/ionic.js"></script>
    <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
  </head>
  <script type="module">
    import { menuController } from '../../../../dist/ionic/index.esm.js';
    window.menuController = menuController;
  </script>

  <body>
    <main>
      <div class="ion-page" id="main-content">
        <ion-content class="ion-padding">
          <h1>Menu</h1>
          <button id="open-menu" class="expand" onclick="openMenu()">Open Menu</button>
        </ion-content>
      </div>

      <ion-menu menu-id="menu" content-id="main-content">
        <ion-header>
          <ion-toolbar>
            <ion-title>Menu</ion-title>
          </ion-toolbar>
        </ion-header>
        <ion-content>
          <h1 class="ion-margin">Open Menu</h1>
          <ion-list>
            <ion-item>
              <ion-button>Button</ion-button>
            </ion-item>
            <ion-item>
              <ion-button>Button 2</ion-button>
            </ion-item>
            <ion-item>Menu Item</ion-item>
            <ion-item>Menu Item</ion-item>
            <ion-item>Menu Item</ion-item>
          </ion-list>
        </ion-content>
      </ion-menu>
    </main>

    <script>
      async function openMenu() {
        await menuController.enable(true, 'menu');
        await menuController.open('menu');
      }
    </script>
  </body>
</html>
